import request from '@/utils/request'
export const login = (data) => request.post('/authorizations', data)

export const getSmsCode = (mobile) => {
  return request({
    url: `/sms/codes/${mobile}`
  })
}

//  获取用户自己的信息
export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: 'user'
  })
}

// 获取指定用户信息
export const getUserProfile = () => {
  return request({
    method: 'GET',
    url: '/user/profile'
  })
}

// 更新昵称
export const updateUserName = (data) => {
  return request({
    method: 'PATCH',
    url: '/user/profile',
    data
  })
}
